/*-------------------------------------------------
ID 生成器，根据类别生成唯一ID

2009-7-13   create by tss  
---------------------------------------------------*/

//全局变量
var Variable = {
		category : 'id',   //类别作为前缀
		max : 5            //最大位
};

/**
 * ID 生成器类
 */
var IDGenerate = function(category,max){
	
	if(typeof(cateogry) != "undefined"){
		this.category = category;
	}else{
		this.category = Variable.category;
	}
	if(typeof(max) != "undefined"){
		this.max = max;
	}else{
		this.max = Variable.max;
	}
	this.list = new Array();
};

/**
 * 获得ID
 * @return
 */
IDGenerate.prototype.getId = function(){
	
	var result = this.category + this.list.length;
	this.list.push(result);
	return result;
	
};

